<!DOCTYPE html>
<!-- saved from url=(0023)http://www.taffydb.com/ -->
<html lang="en" class="gr__taffydb_com"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
     
  <title>TaffyDB - The JavaScript Database</title>
  <meta name="description" content="">
  
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <script id="twitter-wjs" src="./index_files/widgets.js.download"></script><script type="text/javascript" async="" src="./index_files/ga.js.download"></script><script type="text/javascript" src="./index_files/XRegExp.js.download"></script> <!-- XRegExp is bundled with the final shCore.js during build -->
	<script type="text/javascript" src="./index_files/shCore.js.download"></script>
	<script type="text/javascript" src="./index_files/shBrushJScript.js.download"></script>

	<link type="text/css" rel="stylesheet" href="./index_files/shCore.css">
	<link type="text/css" rel="Stylesheet" href="./index_files/shThemeDefault.css">
	<script type="text/javascript">SyntaxHighlighter.all();</script>
    <!-- Le styles -->

    <link href="./index_files/bootstrap.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
      .sidebar-nav {
        padding: 9px 0;
      }
     .toolbar {
			opacity:0;
		}

	 .method {

		}
		.method td {
			border-bottom:thin solid silver;
			border-top:thin solid silver;
			vertical-align:text-top;
		}
		.method td:first-child {
			color:gray;
			background-color:#F2EDEF;
			font-size:160%;
			text-align:center;
			vertical-align:middle;
		}
		b {
			background-color:#F2EDEF;
		}
    </style>
    <link href="./index_files/bootstrap-responsive.css" rel="stylesheet">

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="http://www.taffydb.com/ico/favicon.ico">

    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://www.taffydb.com/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://www.taffydb.com/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://www.taffydb.com/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="http://www.taffydb.com/ico/apple-touch-icon-57-precomposed.png">
  <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-130587-11']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

  <script type="text/javascript" charset="utf-8" async="" src="./index_files/timeline.619317855a58aa2366562a395f9e40ef.js.download"></script></head>

  <body data-gr-c-s-loaded="true">

    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">

        <div class="container-fluid">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="/">TaffyDB</a>
          <div class="pull-right">
            <a class="btn" href="https://github.com/typicaljoe/taffydb">
            taffy.js
            </a>
          </div>
          <div class="nav-collapse">
            <ul class="nav">
              <li class="active"><a href="/">Home</a></li>
              <li><a href="https://github.com/typicaljoe/taffydb/archive/master.zip">Download</a></li>
              <li><a href="/beginner.html">Beginner's Guide</a></li>
              <li><a href="/writing_queries.html">Writing Queries</a></li>
              <li><a href="/working_with_data.html">Working With Data</a></li>
              <li><a href="extentions.html">Extensions</a></li>
             </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container-fluid">
      <div class="row-fluid">
        <div class="span3">

          <div class="well sidebar-nav">
            <ul class="nav nav-list">
              <li class="nav-header">On Github</li>
              <li><a href="https://github.com/typicaljoe/taffydb">GitHub Home</a></li>

              <li><a href="https://github.com/typicaljoe/taffydb/archive/master.zip">Download</a></li>
              <li><a href="https://github.com/typicaljoe/taffydb/blob/master/taffy.js">Source Code</a></li>
                           <form id="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="ENS2E6Z99PDZN">
</form>
              <li class="nav-header">Community and Support</li>
              <li><a href="https://github.com/typicaljoe/taffydb/issues?state=open">Open Issues</a></li>

              <li><a href="#" onclick="document.getElementById('paypal').submit()">Donate</a>
</li>


              <li class="nav-header">Created by</li>
           <iframe id="twitter-widget-0" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" class="twitter-timeline twitter-timeline-rendered" style="position: static; visibility: visible; display: inline-block; width: 520px; height: 600px; padding: 0px; border: none; max-width: 100%; min-width: 180px; margin-top: 0px; margin-bottom: 0px; min-height: 200px;" data-widget-id="249607754170368000" title="Twitter Timeline" src="./index_files/saved_resource.html"></iframe>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>


            </ul>


          </div><!--/.well -->

        </div><!--/span-->
        <div class="span9">
          <div class="hero-unit">

               
   <h1>The JavaScript Database</h1>
            
            <p>An opensouce library that brings database features into your JavaScript applications.</p>
            <h2>Introduction</h2>

<p>How you ever noticed how JavaScript object literals look a lot like records? And that if you wrap a group of them up in an array you have something that looks a lot like a database table? TaffyDB is a library to bring powerful database funtionality to that concept and rapidly improve the way you work with data inside of JavaScript.</p>

<h2>What makes it sticky</h2>

<ul>
<li>Small file size, extremely fast queries</li>
<li>Powerful JavaScript centric data selection engine</li>
<li>Database inspired features such as count, update, and insert</li>
<li>Robust cross browser support</li>
<li>Easily extended with your own functions</li>
<li>Compatible with any DOM library (jQuery, YUI, Dojo, etc)</li>
<li>Compatible with Server Side JS</li>
</ul>
<h2>Create a Database</h2>
			<pre class="brush: js">// Create DB and fill it with records
var friends = TAFFY([
	{"id":1,"gender":"M","first":"John","last":"Smith","city":"Seattle, WA","status":"Active"},
	{"id":2,"gender":"F","first":"Kelly","last":"Ruth","city":"Dallas, TX","status":"Active"},
	{"id":3,"gender":"M","first":"Jeff","last":"Stevenson","city":"Washington, D.C.","status":"Active"},
	{"id":4,"gender":"F","first":"Jennifer","last":"Gill","city":"Seattle, WA","status":"Active"}	
]);
</pre>

<h2>Filter using the database name and object comparison</h2>
			<pre class="brush: js">// Find all the friends in Seattle
friends({city:"Seattle, WA"});

// Find John Smith, by ID
friends({id:1});

// Find John Smith, by Name
friends({first:"John",last:"Smith"});
</pre>

<h2>Access data easily</h2>
			<pre class="brush: js">// Kelly's record
var kelly = friends({id:2}).first();

// Kelly's last name
var kellyslastname = kelly.last;

// Get an array of record ids
var cities = friends().select("id");

// Get an array of distinct cities
var cities = friends().distinct("city");

// Apply a function to all the male friends
friends({gender:"M"}).each(function (r) {
   alert(r.name + "!");
});
</pre>

<h2>Modify data on the fly</h2>
			<pre class="brush: js">// Move John Smith to Las Vegas
friends({first:"John",last:"Smith"}).update({city:"Las Vegas, NV:"});

// Remove Jennifer Gill as a friend
friends({id:4}).remove();

// insert a new friend
friends.insert({"id":5,"gender":"F","first":"Jennifer","last":"Gill","city":"Seattle, WA","status":"Active"});
</pre>

<p><a class="btn btn-primary btn-large" href="https://github.com/typicaljoe/taffydb/archive/master.zip">Download »</a></p>



          </div>
           <footer>
         
  <div class="row-fluid">
            <div class="span4">
              <h2>Beginner's Guide</h2>
              <p>A quick intro to getting your first DB up in running from scratch.</p>
              <p><a class="btn" href="/beginner.html">View details »</a></p>
            </div><!--/span-->

            <div class="span4">
              <h2>Writing queries</h2>
              <p>The heart of TaffyDB and any database is running queries against your data. This is done after creation of your database by calling the root function and building Filter Objects.</p>
              <p><a class="btn" href="/writing_queries.html">View details »</a></p>
            </div><!--/span-->
            <div class="span4">
              <h2>Using and modifying data</h2>

              <p>The basics for ordering, inserting, updating, deleting, and using your data in an application.</p>
              <p><a class="btn" href="/working_with_data.html">View details »</a></p>
            </div><!--/span-->
          </div><!--/row-->
          <div class="row-fluid">
            <div class="span4">
              <h2>Extensions</h2>

              <p>TaffyDB is easy to extend. Write your own plugins or model whole applications with TaffyDB as the backbone.</p>
              <p><a class="btn" href="/working_with_data.html">View details »</a></p>
            </div><!--/span-->
            <div class="span4">
              <h2>Fork It!</h2>
              <p>Use and modify the library for your own projects and contribute code back to the master library</p>
              <p><a class="btn" href="https://github.com/typicaljoe/taffydb">View details »</a></p>
            </div><!--/span-->
          </div><!--/row-->

    </footer>


        </div><!--/span-->
      </div><!--/row-->

      <hr>

      <footer>
        <div align="center"><img src="./index_files/taffydbboxV3.jpg"></div>
      </footer>

    </div><!--/.fluid-container-->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="./index_files/jquery.js.download"></script>
    <script src="./index_files/bootstrap-transition.js.download"></script>
    <script src="./index_files/bootstrap-alert.js.download"></script>
    <script src="./index_files/bootstrap-modal.js.download"></script>

    <script src="./index_files/bootstrap-dropdown.js.download"></script>
    <script src="./index_files/bootstrap-scrollspy.js.download"></script>
    <script src="./index_files/bootstrap-tab.js.download"></script>
    <script src="./index_files/bootstrap-tooltip.js.download"></script>
    <script src="./index_files/bootstrap-popover.js.download"></script>
    <script src="./index_files/bootstrap-button.js.download"></script>

    <script src="./index_files/bootstrap-collapse.js.download"></script>
    <script src="./index_files/bootstrap-carousel.js.download"></script>
    <script src="./index_files/bootstrap-typeahead.js.download"></script>

  

<iframe id="rufous-sandbox" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" style="position: absolute; visibility: hidden; display: none; width: 0px; height: 0px; padding: 0px; border: none;" title="Twitter analytics iframe" src="./index_files/saved_resource(1).html"></iframe></body></html>
